package persentation.presentUniversityDean;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;

import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

import persentation.presentLogin.LoginFrame;
import businesslogic.frameworkBl.FrameworkController;
import businesslogic.teachPlanBl.TeachPlanController;
import businesslogic.userBl.UniversityDeanController;

public class UniversityDeanFrame extends JFrame {

	private JPanel contentPane;
	private ButtonPanel buttonPanel;
	private Title title;
	private MyTabbedPane tabbedPane;

	/**
	 * Launch the application.
	 */

	public static void main(String[] args) {

		UIManager.put("RootPane.setupButtonVisible", false);
		BeautyEyeLNFHelper.translucencyAtFrameInactive = false;
		try {
			org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
		} catch (Exception e) {
			e.printStackTrace();
		}
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UniversityDeanFrame frame = new UniversityDeanFrame("U00001");
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public UniversityDeanFrame(String uDeanID) {

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setResizable(false);
		setTitle("南京大学选课系统");
		setSize(1100, 750);
		Toolkit toolkit = Toolkit.getDefaultToolkit();
		Dimension screen = toolkit.getScreenSize();
		int x = (int) (screen.getWidth() - this.getWidth()) >> 1;
		int y = (((int) ((screen.getHeight() - this.getHeight()) - 15) >> 1));
		setLocation(x, y);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		tabbedPane = new MyTabbedPane();
		//tabbedPane.setBounds(221, 85, 879, 626);
		tabbedPane.setBounds(220, 90, 810, 621);
		contentPane.add(tabbedPane);
		tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);

		title = new Title(uDeanID, this,tabbedPane);
		title.setSize(1185, 86);
		title.setBackground(Color.WHITE);
		contentPane.add(title);
		title.setLocation(0, 0);

		buttonPanel = new ButtonPanel(tabbedPane, uDeanID);
		buttonPanel.setBounds(0, 85, 221, 600);
		contentPane.add(buttonPanel);
		
		new ExceptionHandler(this, new LoginFrame());
	}

}
